﻿<Window x:Class="Vtron.HipcConfigurationTools.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:Vtron.HipcConfigurationTools"
        Title="HIPC 配置管理工具"
        Height="768" Width="1024" WindowStartupLocation="CenterScreen"
        ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
    <Window.Background>
        <ImageBrush ImageSource="Resources/background.png"  Stretch="UniformToFill"/>
    </Window.Background>
    <Window.Resources>
        <Storyboard x:Key="InTransition">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Title" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.01" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Logo" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.5000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Logo" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-50"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="-101"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:02.5000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-72"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="-157"/>
                <SplineDoubleKeyFrame KeySpline="0.5,0,0.5,1" KeyTime="00:00:01.5000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="MainToolbar" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="MainToolbar" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="100"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="100"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0" KeySpline="0,0.495999991893768,0.504000008106232,1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SideGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1" KeySpline="0,0.5,0.5,1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.5000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SideGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="400"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="400"/>
                <SplineDoubleKeyFrame KeySpline="0,1,0.5,1" KeyTime="00:00:02" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.5000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SideGrid" Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)">
                <SplinePointKeyFrame KeyTime="00:00:00" Value="0.5,0"/>
                <SplinePointKeyFrame KeyTime="00:00:01.5000000" Value="0.5,0"/>
                <SplinePointKeyFrame KeyTime="00:00:02" Value="0.5,0"/>
                <SplinePointKeyFrame KeyTime="00:00:02.5000000" Value="0.5,0"/>
            </PointAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SideGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="304.47500610351562"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.5000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </Window.Resources>
    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource InTransition}"/>
        </EventTrigger>
    </Window.Triggers>
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top">
        <Grid Grid.Row="1" RenderTransformOrigin="0.5,0.5" Margin="20,0,20,20">
            <Grid.RowDefinitions>
                <RowDefinition Height="124" />
                <RowDefinition Height="4*" />
                <RowDefinition Height="0" x:Name="row" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" MinWidth="650" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <!-- logo -->
            <Canvas x:Name="Logo" Grid.ColumnSpan="2" RenderTransformOrigin="0.5,0.5">
                <Canvas.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Canvas.RenderTransform>
                <TextBlock Text="VTRON " TextWrapping="NoWrap" Foreground="#FFC72424" FontSize="72" Opacity="0.85" Canvas.Left="0" Canvas.Top="5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="80"  TextAlignment="Left" FontWeight="Bold" />
                <TextBlock Text="HIPC" TextWrapping="NoWrap" Foreground="White" FontSize="72" Opacity="0.85" Height="80" TextAlignment="Left" FontWeight="Normal" Canvas.Left="300" Canvas.Top="5"/>
            </Canvas>

            <!-- title -->
            <Canvas x:Name="Title" Grid.ColumnSpan="2" RenderTransformOrigin="0.5,0.5" Opacity="0">
                <Canvas.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Canvas.RenderTransform>
                <TextBlock x:Name="CodecTitle" Text="0.0.0.0 " TextWrapping="NoWrap" Foreground="#FFC4CFD6" FontSize="72" Opacity="0.85" Canvas.Left="0" Canvas.Top="5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="80"  TextAlignment="Left" FontWeight="Bold" />
            </Canvas>

            <!-- main bar -->
            <ItemsControl x:Name="MainToolbar" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0" Grid.Row="1" RenderTransformOrigin="0.5,0.5">
                <ItemsControl.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </ItemsControl.RenderTransform>
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.Items>
                    <Controls:AddCodecView>
                        <Controls:AddCodecView.DataContext>
                            <Controls:AddCodecViewModel/>
                        </Controls:AddCodecView.DataContext>
                    </Controls:AddCodecView>
                </ItemsControl.Items>
            </ItemsControl>

            <!-- content -->
            <Grid x:Name="ContentGrid" Grid.Row="1" RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Grid.RenderTransform>
                <Controls:AnimatedTabControl
                    x:Name="CodecTab"
                    SelectedIndex="0"  
                    VerticalAlignment="Stretch"
                    ItemContainerStyle="{StaticResource ShellTabItemStyle}" 
                    Background="{StaticResource headerBarBG}" 
                    AutomationProperties.AutomationId="PositionSummaryTab" >
                    <!--<TabItem x:Name="encodedTabItem">
                        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                            <Controls:EncodedListView/>
                        </ScrollViewer>
                    </TabItem>
                    <TabItem x:Name="decodeTabItem">
                        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                            <Controls:DecodeListView/>
                        </ScrollViewer>
                    </TabItem>-->
                    <TabItem x:Name="codecTabItem">
                        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                            <Controls:CodecListView/>
                        </ScrollViewer>
                    </TabItem>
                    <TabItem x:Name="codecConnectTabItem">
                        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                            <Controls:CodecConnectView/>
                        </ScrollViewer>
                    </TabItem>
                </Controls:AnimatedTabControl>
            </Grid>

            <!-- details -->
            <Grid x:Name="DetailsGrid" Grid.Row="2" Margin="10,10,10,10" RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Grid.RenderTransform>
                <ContentControl x:Name="ActionContent">
                    <ContentControl.Template>
                        <ControlTemplate TargetType="ContentControl">
                            <Grid>
                                <Controls:RoundedBox />
                                <!--<ContentPresenter Margin="10,0,10,0" Content="{TemplateBinding Content}" />-->

                               <!--<Grid Background="{x:Null}" Margin="10">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                     <ScrollViewer VerticalAlignment="Top" HorizontalAlignment="Stretch" VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Top" BorderThickness="0,0,0,0" Grid.RowSpan="1" Grid.Row="0">
                                        <ListBox x:Name="OrdersListBox" BorderThickness="0" ItemContainerStyle="{StaticResource ShellThemeListBoxStyle}" 
                     IsSynchronizedWithCurrentItem="True" 
                     cal:RegionManager.RegionName="{x:Static inf:RegionNames.OrdersRegion}" Background="#00000000">
                                            <ListBox.ItemTemplate>
                                                <DataTemplate>
                                                    <orders:OrderCompositeView/>
                                                </DataTemplate>
                                            </ListBox.ItemTemplate>
                                        </ListBox>
                                        <Grid  HorizontalAlignment="Center" Margin="10">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="65"/>
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>
                                            <TextBlock Grid.Row="0" Grid.Column="0" Text="编码盒:" Foreground="#FF444444" VerticalAlignment="Center" Width="Auto" Height="Auto" HorizontalAlignment="Right" Grid.ColumnSpan="1" Margin="5,0,0,0" />
                                            <ComboBox x:Name="EncodedCombo" DisplayMemberPath="Ip"  Grid.Row="0" Grid.Column="1" Width="120" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="5,0,20,0" />
                                            <TextBlock Grid.Row="0" Grid.Column="2" Text="解码盒:" Foreground="#FF444444" VerticalAlignment="Center" Width="Auto" Height="Auto" HorizontalAlignment="Right" Grid.ColumnSpan="1" Margin="5,0,0,0" />
                                            <ComboBox x:Name="DecodeCombo" DisplayMemberPath="Ip" Grid.Row="0" Grid.Column="3" Width="120" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="5,0,0,0" />
                                        </Grid>
                                    </ScrollViewer>
                                    <StackPanel Height="Auto" VerticalAlignment="Bottom" Orientation="Horizontal" Grid.RowSpan="1" HorizontalAlignment="Center" Grid.Row="1" Margin="5">
                                        <Button Name="SubmitButton" Template="{StaticResource SubmitButtonTemplate}" Cursor="Hand" Height="25">连接</Button>
                                        <Button Name="CancelButton" Template="{StaticResource CancelButtonTemplate}" Cursor="Hand" Height="25">取消</Button>
                                    </StackPanel>
                                </Grid>-->
                            </Grid>
                            <ControlTemplate.Triggers>
                                <!--<Trigger Property="HasContent" Value="false">
                                    <Setter Property="Visibility" Value="Collapsed" />
                                </Trigger>-->
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </ContentControl.Template>
                </ContentControl>
            </Grid>

            <!-- sidebar -->
            <Grid x:Name="SideGrid" Margin="10,29,10,10" Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" RenderTransformOrigin="0.5,0.5" Width="Auto">
                <Grid.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Grid.RenderTransform>
                <Controls:ResearchControl x:Name="researchControl">
                    <Controls:ResearchControl.Template>
                        <ControlTemplate TargetType="Controls:ResearchControl">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Border Grid.Row="0" Height="30" CornerRadius="12,12,12,12" Margin="0,0,0,10" BorderBrush="#FFFFFFFF" BorderThickness="2,2,2,2" x:Name="rightHeader" Canvas.ZIndex="1" Opacity="0.9" Background="{StaticResource sideBarHeaderBarBG}">
                                    <!--<ItemsControl ItemsSource="{TemplateBinding Headers}" HorizontalAlignment="Center">
                                        <ItemsControl.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <StackPanel Orientation="Horizontal" />
                                            </ItemsPanelTemplate>
                                        </ItemsControl.ItemsPanel>
                                    </ItemsControl>-->
                                    <TextBlock x:Name="titleTextBlock" TextWrapping="NoWrap" Foreground="White" FontSize="16" Height="80" FontWeight="Normal"  HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,3,0,0"/>
                                </Border>
                                <Controls:RoundedBox Grid.Row="1" />
                                <ScrollViewer Grid.Row="1" Width="285" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                                    <ItemsPresenter Width="285" />
                                </ScrollViewer>
                            </Grid>
                        </ControlTemplate>
                    </Controls:ResearchControl.Template>
                </Controls:ResearchControl>
            </Grid>

        </Grid>
    </Grid>
</Window>
